package com.android.examplelist;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import com.nhaarman.supertooltips.ToolTip;
import com.nhaarman.supertooltips.ToolTipRelativeLayout;
import com.nhaarman.supertooltips.ToolTipView;
import com.nhaarman.supertooltips.ToolTipView.OnToolTipViewClickedListener;

public class SuperToolTipActivity extends Activity implements
		OnToolTipViewClickedListener {

	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.supertooltip);
		getActionBar().setDisplayHomeAsUpEnabled(true);



	}
	
	public void ShowTips(View tab) {
		
		ToolTipRelativeLayout toolTipRelativeLayout = (ToolTipRelativeLayout) findViewById(R.id.activity_main_tooltipRelativeLayout);

		String text = "This project has been abandoned. Feel free to fork this project, though no support will be given.SuperToolTips is an Open Source Android library that allows developers to easily create Tool Tips for views. Feel free to use it all you want in your Android apps provided that you cite this project and include the license in your app.";

		
		
		ToolTip toolTip = new ToolTip().withText(text).withColor(Color.RED).withAnimationType(ToolTip.AnimationType.NONE);
		//ToolTip toolTip = new ToolTip().withText(text).withColor(Color.RED).withShadow().withAnimationType(ToolTip.AnimationType.FROM_TOP);
		ToolTipView myToolTipView = toolTipRelativeLayout.showToolTipForView(
				toolTip, findViewById(R.id.activity_main_redtv));
		myToolTipView
				.setOnToolTipViewClickedListener(SuperToolTipActivity.this);
		
	}
	

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case android.R.id.home:
			finish();
			return true;
		case R.id.action_settings:
			return true;
		}

		return super.onOptionsItemSelected(item);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

	@Override
	public void onToolTipViewClicked(ToolTipView toolTipView) {
		// TODO Auto-generated method stub

	}

}
